#define _CRT_SECURE_NO_WARNINGS 1
#include"Head.h"

class Solution {
public:
    int firstUniqChar(string s) {
        int countTable[26] = { 0 };
        for (auto e : s)
        {
            countTable[e - 97]++;
        }
        for (int i = 0; i < s.size(); i++)
        {
            if (countTable[s[i] - 97] == 1)
                return i;
        }
        return -1;
    }
};
